#ifndef __PROCESS_SHR_MEM__
#define __PROCESS_SHR_MEM__

#include "IUtility.h"
#include "IContainer.h"
#include "ISysResources.h"
#include "ShrMemQueue.h"

class CProcessShrMem : public virtual IProcessShrMem
{
INIT_CLASS_PRODUCT(CProcessShrMem)
public:
	const bool Init(const void * pvdPara, char * pszMsgTxt, int iMsgTxtSize) override final;
	const void UnInit() override final;
	const char * DataBuf() const override final;
	const long long ProcessID() const;
	const bool Finish() override final;
	const char * SequenceNo();
	const bool WriteShrMem(void * ptrPktInfo) override final;
	const bool WriteCurMem(void * ptrPktInfo) override final;
	const void SetDataBuf(const char * szDataBuf, const long long llSize, const int iPktSize, long long llProID) override final;
    const bool TOP_FLAG();
    void SetTopFlag(bool bTopFlg);
private:
	char * m_ptrBuf;
	shared_ptr<ILock> m_ptrLock;
	vector< int > m_vtPktStatus;
	int m_iPktSize, m_iPktIndex;
	long long m_llPktCount, m_llSumByteNum;
	string m_strSequenceNo;
	long long m_llProID;
    bool m_bTopFlg;

private:
	const void SetPktStatus(const int iPktIndex, const int iValue);

};

#endif//__PROCESS_SHR_MEM__